const app = getApp();
Page({
  data: {
    num1:0,
    num2:0,
    num3:0,
    num4:0
  },
  onShow(){
    this.getNum()
  },
  onLoad: function (options) {
    
  },
  letgo(e) {
    let num = e.currentTarget.dataset.num;
    if (num == 1) {
      wx.navigateTo({
        url: './withdraw/withdraw?num='+this.data.num2,
      })
    } else if (num == 2) {
      wx.navigateTo({
        url: './order/order',
      })
    } else if (num == 3) {
      wx.navigateTo({
        url: './friend/friend',
      })
    } else if (num == 4) {
      wx.navigateTo({
        url: './share/share',
      })
    }
  },
  getNum() {
    app.util.request({
      url: '/commission/index'
    }).then(res => {
      this.setData({
        num1: res.data.commission.total,
        num2: res.data.commission.money,
        num3: res.data.commission.order_count,
        num4: res.data.commission.tuser_count
      })
    })
  },
})